//引入常量
import { GET_MIAOSHA_DATA, GET_SWIPER_DATA, GET_TUIJIAN_DATA, GET_ITEMOBJ_DATA, GET_SWIPERARR_DATA, GET_JIESHAOLIST_DATA } from '../content';

//设置初始化的值 
const initData = {};
const wzdata = (state = initData, action) => {
    const { type, data } = action;
    switch (type) {
        case GET_MIAOSHA_DATA://接收秒杀数据
            return Object.assign({}, state, { miaoshaObj: data });
        case GET_SWIPER_DATA://轮播数据
            return Object.assign({}, state, { swiperList: data });
        case GET_TUIJIAN_DATA://推荐数据
            return Object.assign({}, state, { tuijianList: data });
        case GET_ITEMOBJ_DATA://推荐数据
            return Object.assign({}, state, { itemObj: data });
        case GET_SWIPERARR_DATA://推荐数据
            return Object.assign({}, state, { swiperArr: data });
        case GET_JIESHAOLIST_DATA://推荐数据
            return Object.assign({}, state, { jieshaolist: data });
        default:
            return state;
    }
}

export default wzdata;